using UnityEngine;

public class GameGuideUI : MonoBehaviour
{
	public UIPanel curpanel;

	public Transform fingerflag;

	public UIWidget fingerwi;

	public Transform panelparent;

	public Transform dirflag;

	public UIWidget dirwi;

	public Transform curshow;

	public Transform oldparent;

	public int curstepindex;

	private GameObject uiobj;

	public GameObject gunweaponobj;

	public GameObject missileobj;

	public GameObject minimapobj;

	public GameObject joystickobj;

	public GameObject speedobj;

	public GameObject pauseobj;

	public GameObject midviewobj;

	public GameObject setobj;

	public TweenPosition fingeranima;

	public void stepstart()
	{
		NGUITools.SetActive(gunweaponobj, state: false);
		NGUITools.SetActive(missileobj, state: false);
		NGUITools.SetActive(minimapobj, state: false);
		NGUITools.SetActive(joystickobj, state: false);
		NGUITools.SetActive(speedobj, state: false);
		NGUITools.SetActive(pauseobj, state: false);
		NGUITools.SetActive(midviewobj, state: false);
		NGUITools.SetActive(setobj, state: false);
	}

	public void step1()
	{
		enable();
		NGUITools.SetActive(speedobj, state: true);
		NGUITools.SetActive(midviewobj, state: true);
		curshow = speedobj.transform;
		fingerflag.parent = curshow.parent;
		fingerflag.localPosition = curshow.localPosition + Vector3.up * 30f + Vector3.right * 10f;
		fingerflag.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 36f));
		fingerwi.alpha = 1f;
		fingerwi.gameObject.SetActive(true);
	}

	public void step2()
	{
		NGUITools.SetActive(joystickobj, state: true);
		curshow = joystickobj.transform;
		dirflag.parent = curshow.parent;
		dirflag.localPosition = curshow.localPosition + new Vector3(125f, 132f, 0f);
		fingerflag.parent = curshow.parent;
		fingerflag.localPosition = curshow.localPosition + new Vector3(125f, 100f, 0f);
		fingerflag.localRotation = Quaternion.Euler(Vector3.zero);
		dirwi.alpha = 1f;
		dirwi.gameObject.SetActive(true);
		fingerwi.alpha = 1f;
		fingerwi.gameObject.SetActive(true);
		fingeranima.PlayForward();
		NGUITools.SetActive(dirflag.gameObject, state: false);
		NGUITools.SetActive(fingerflag.gameObject, state: false);
		NGUITools.SetActive(dirflag.gameObject, state: true);
		NGUITools.SetActive(fingerflag.gameObject, state: true);
	}

	public void step3()
	{
		fingeranima.enabled = false;
		NGUITools.SetActive(minimapobj, state: true);
	}

	public void step4()
	{
		NGUITools.SetActive(gunweaponobj, state: true);
		NGUITools.SetActive(missileobj, state: true);
	}

	public void step4_gun()
	{
		NGUITools.SetActive(gunweaponobj, state: true);
		curshow = gunweaponobj.transform;
		fingerflag.parent = curshow.parent;
		fingerflag.localPosition = curshow.localPosition - Vector3.up * 20f;
		fingerflag.localRotation = Quaternion.Euler(Vector3.zero);
		fingerwi.alpha = 1f;
		fingerwi.gameObject.SetActive(true);
	}

	public void step4_missile()
	{
		NGUITools.SetActive(missileobj, state: true);
		curshow = missileobj.transform;
		fingerflag.parent = curshow.parent;
		fingerflag.localPosition = curshow.localPosition - Vector3.up * 20f;
		fingerflag.localRotation = Quaternion.Euler(Vector3.zero);
		fingerwi.alpha = 1f;
		fingerwi.gameObject.SetActive(true);
	}

	public void enable()
	{
		if (uiobj == null)
		{
			uiobj = base.gameObject;
		}
		NGUITools.SetActive(uiobj, state: true);
	}

	public void disappear_finger()
	{
		fingerwi.alpha = 0f;
		fingerwi.gameObject.SetActive(false);
		fingerflag.parent = panelparent;
	}

	public void disappear_dir()
	{
		dirwi.alpha = 0f;
		dirwi.gameObject.SetActive(false);
		dirflag.parent = panelparent;
	}

	public void disable()
	{
		NGUITools.SetActive(uiobj, state: false);
	}
}
